package com.nuanshui.heatedloan.dao.cms.security;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.nuanshui.heatedloan.entity.cms.security.User;


public interface UserDao extends JpaRepository<User, Long>,
		JpaSpecificationExecutor<User>, UserDaoCustom{
	// 根据登录名查找用户
	User findByUsername(String Username);

	// 根据实名查找用户
	User findByRealname(String realname);

	// 根据包含登录名(类似like)查找用户
	Page<User> findByUsernameContaining(String Username, Pageable pageable);
	
    @Query(value="delete from cms_security_user where id =?1",nativeQuery=true)
    @Modifying
    void deleteById(Long id);
	
	
}